var userSetting = avalon.define("userSetting", function(vm) {
	vm.currentTabId = 'personalInformation';
	vm.pointerMarginTop = 0;
	vm.currentSetNumberTab = 'authenticate';
	
	vm.title = '个人资料';
	
	//切换左边栏
	vm.changeTab = function(){
		var tabId = this.getAttribute('data-id');
		vm.currentTabId = tabId;
		//切换小指针
		var item = $(".userSetting ul.tabsUl li.active")[0];
		vm.pointerMarginTop = item.offsetTop - 28 < 0?0:item.offsetTop - 28;
		
		//切换标题
		switch (vm.currentTabId){
			case 'personalInformation':
				vm.title = '个人资料';
				break;
			case 'changePassword':
				vm.title = '修改密码';
				break;
			case 'modifyPhoneNum':
				vm.title = '修改手机号';
				break;
			default:
				break;
		}
	};
	
	//点击下一步
	vm.nextStep = function(step){
		switch (step){
			case 1:
				//TODO 经过一系列操作跳转到第二步
				vm.currentSetNumberTab = 'setNewNumber';
				break;
			case 2:
				//TODO 经过一系列操作跳转到第三步
				vm.currentSetNumberTab = 'setNumberSuccess';
				break;
			default:
				break;
		}
	}
});
avalon.scan();